home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / g_man / cat3 / OpenGL / gllightmodel.z / gllightmodel
Encoding:
Text File  |  2001-04-17  |  15.0 KB  |  199 lines

  1.  
  2.  
  3.  
  4. ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeellll((((3333GGGG))))               OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee               ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeellll((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeellllffff,,,, ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeelllliiii,,,, ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeellllffffvvvv,,,, ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeelllliiiivvvv - set the
  10.      lighting model parameters
  11.  
  12.  
  13. CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  14.      void ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeellllffff( GLenum _p_n_a_m_e,
  15.                          GLfloat _p_a_r_a_m )
  16.      void ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeelllliiii( GLenum _p_n_a_m_e,
  17.                          GLint _p_a_r_a_m )
  18.  
  19.  
  20. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  21.      _p_n_a_m_e   Specifies a single-valued lighting model parameter.
  22.              GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____LLLLOOOOCCCCAAAALLLL____VVVVIIIIEEEEWWWWEEEERRRR, GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____CCCCOOOOLLLLOOOORRRR____CCCCOOOONNNNTTTTRRRROOOOLLLL, and
  23.              GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____TTTTWWWWOOOO____SSSSIIIIDDDDEEEE are accepted.
  24.  
  25.      _p_a_r_a_m   Specifies the value that _p_a_r_a_m will be set to.
  26.  
  27. CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  28.      void ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeellllffffvvvv( GLenum _p_n_a_m_e,
  29.                           const GLfloat *_p_a_r_a_m_s )
  30.      void ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeelllliiiivvvv( GLenum _p_n_a_m_e,
  31.                           const GLint *_p_a_r_a_m_s )
  32.  
  33.  
  34. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  35.      _p_n_a_m_e
  36.           Specifies a lighting model parameter.  GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____AAAAMMMMBBBBIIIIEEEENNNNTTTT,
  37.           GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____CCCCOOOOLLLLOOOORRRR____CCCCOOOONNNNTTTTRRRROOOOLLLL, GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____LLLLOOOOCCCCAAAALLLL____VVVVIIIIEEEEWWWWEEEERRRR, and
  38.           GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____TTTTWWWWOOOO____SSSSIIIIDDDDEEEE are accepted.
  39.  
  40.      _p_a_r_a_m_s
  41.           Specifies a pointer to the value or values that _p_a_r_a_m_s will be set
  42.           to.
  43.  
  44. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  45.      ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeellll sets the lighting model parameter.  _p_n_a_m_e names a parameter
  46.      and _p_a_r_a_m_s gives the new value.  There are three lighting model
  47.      parameters:
  48.  
  49.      GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____AAAAMMMMBBBBIIIIEEEENNNNTTTT
  50.                _p_a_r_a_m_s contains four integer or floating-point values that
  51.                specify the ambient RGBA intensity of the entire scene.
  52.                Integer values are mapped linearly such that the most positive
  53.                representable value maps to 1.0, and the most negative
  54.                representable value maps to -1.0.  Floating-point values are
  55.                mapped directly.  Neither integer nor floating-point values are
  56.                clamped.  The initial ambient scene intensity is (0.2, 0.2,
  57.                0.2, 1.0).
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeellll((((3333GGGG))))               OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee               ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeellll((((3333GGGG))))
  71.  
  72.  
  73.  
  74.      GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____CCCCOOOOLLLLOOOORRRR____CCCCOOOONNNNTTTTRRRROOOOLLLL
  75.                _p_a_r_a_m_s must be either GGGGLLLL____SSSSEEEEPPPPAAAARRRRAAAATTTTEEEE____SSSSPPPPEEEECCCCUUUULLLLAAAARRRR____CCCCOOOOLLLLOOOORRRR or
  76.                GGGGLLLL____SSSSIIIINNNNGGGGLLLLEEEE____CCCCOOOOLLLLOOOORRRR.  GGGGLLLL____SSSSIIIINNNNGGGGLLLLEEEE____CCCCOOOOLLLLOOOORRRR specifies that a single color
  77.                is generated from the lighting computation for a vertex.
  78.                GGGGLLLL____SSSSEEEEPPPPAAAARRRRAAAATTTTEEEE____SSSSPPPPEEEECCCCUUUULLLLAAAARRRR____CCCCOOOOLLLLOOOORRRR specifies that the specular color
  79.                computation of lighting be stored separately from the remainder
  80.                of the lighting computation.  The specular color is summed into
  81.                the generated fragment's color after the application of texture
  82.                mapping (if enabled).  The initial value is GGGGLLLL____SSSSIIIINNNNGGGGLLLLEEEE____CCCCOOOOLLLLOOOORRRR.
  83.  
  84.      GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____LLLLOOOOCCCCAAAALLLL____VVVVIIIIEEEEWWWWEEEERRRR
  85.                _p_a_r_a_m_s is a single integer or floating-point value that
  86.                specifies how specular reflection angles are computed.  If
  87.                _p_a_r_a_m_s is 0 (or 0.0), specular reflection angles take the view
  88.                direction to be parallel to and in the direction of the -_z
  89.                axis, regardless of the location of the vertex in eye
  90.                coordinates.  Otherwise, specular reflections are computed from
  91.                the origin of the eye coordinate system.  The initial value is
  92.                0.
  93.  
  94.      GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____TTTTWWWWOOOO____SSSSIIIIDDDDEEEE
  95.                _p_a_r_a_m_s is a single integer or floating-point value that
  96.                specifies whether one- or two-sided lighting calculations are
  97.                done for polygons.  It has no effect on the lighting
  98.                calculations for points, lines, or bitmaps.  If _p_a_r_a_m_s is 0 (or
  99.                0.0), one-sided lighting is specified, and only the _f_r_o_n_t
  100.                material parameters are used in the lighting equation.
  101.                Otherwise, two-sided lighting is specified.  In this case,
  102.                vertices of back-facing polygons are lighted using the _b_a_c_k
  103.                material parameters, and have their normals reversed before the
  104.                lighting equation is evaluated.  Vertices of front-facing
  105.                polygons are always lighted using the _f_r_o_n_t material
  106.                parameters, with no change to their normals. The initial value
  107.                is 0.
  108.  
  109.      In RGBA mode, the lighted color of a vertex is the sum of the material
  110.      emission intensity, the product of the material ambient reflectance and
  111.      the lighting model full-scene ambient intensity, and the contribution of
  112.      each enabled light source.  Each light source contributes the sum of
  113.      three terms:  ambient, diffuse, and specular.  The ambient light source
  114.      contribution is the product of the material ambient reflectance and the
  115.      light's ambient intensity.  The diffuse light source contribution is the
  116.      product of the material diffuse reflectance, the light's diffuse
  117.      intensity, and the dot product of the vertex's normal with the normalized
  118.      vector from the vertex to the light source.  The specular light source
  119.      contribution is the product of the material specular reflectance, the
  120.      light's specular intensity, and the dot product of the normalized
  121.      vertex-to-eye and vertex-to-light vectors, raised to the power of the
  122.      shininess of the material.  All three light source contributions are
  123.      attenuated equally based on the distance from the vertex to the light
  124.      source and on light source direction, spread exponent, and spread cutoff
  125.      angle.  All dot products are replaced with 0 if they evaluate to a
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeellll((((3333GGGG))))               OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee               ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeellll((((3333GGGG))))
  137.  
  138.  
  139.  
  140.      negative value.
  141.  
  142.      The alpha component of the resulting lighted color is set to the alpha
  143.      value of the material diffuse reflectance.
  144.  
  145.      In color index mode, the value of the lighted index of a vertex ranges
  146.      from the ambient to the specular values passed to ggggllllMMMMaaaatttteeeerrrriiiiaaaallll using
  147.      GGGGLLLL____CCCCOOOOLLLLOOOORRRR____IIIINNNNDDDDEEEEXXXXEEEESSSS.  Diffuse and specular coefficients, computed with a
  148.      (.30, .59, .11) weighting of the lights' colors, the shininess of the
  149.      material, and the same reflection and attenuation equations as in the
  150.      RGBA case, determine how much above ambient the resulting index is.
  151.  
  152. NNNNOOOOTTTTEEEESSSS
  153.      GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____CCCCOOOOLLLLOOOORRRR____CCCCOOOONNNNTTTTRRRROOOOLLLL is available only if the GL version is 1.2
  154.      or greater.
  155.  
  156. EEEERRRRRRRROOOORRRRSSSS
  157.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEENNNNUUUUMMMM is generated if _p_n_a_m_e is not an accepted value.
  158.  
  159.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEENNNNUUUUMMMM is generated if _p_n_a_m_e is GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____CCCCOOOOLLLLOOOORRRR____CCCCOOOONNNNTTTTRRRROOOOLLLL and
  160.      _p_a_r_a_m_s is not one of GGGGLLLL____SSSSIIIINNNNGGGGLLLLEEEE____CCCCOOOOLLLLOOOORRRR or GGGGLLLL____SSSSEEEEPPPPAAAARRRRAAAATTTTEEEE____SSSSPPPPEEEECCCCUUUULLLLAAAARRRR____CCCCOOOOLLLLOOOORRRR.
  161.  
  162.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____OOOOPPPPEEEERRRRAAAATTTTIIIIOOOONNNN is generated if ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeellll is executed between the
  163.      execution of ggggllllBBBBeeeeggggiiiinnnn and the corresponding execution of ggggllllEEEEnnnndddd.
  164.  
  165. AAAASSSSSSSSOOOOCCCCIIIIAAAATTTTEEEEDDDD GGGGEEEETTTTSSSS
  166.      ggggllllGGGGeeeetttt with argument GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____AAAAMMMMBBBBIIIIEEEENNNNTTTT
  167.      ggggllllGGGGeeeetttt with argument GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____CCCCOOOOLLLLOOOORRRR____CCCCOOOONNNNTTTTRRRROOOOLLLL
  168.      ggggllllGGGGeeeetttt with argument GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____LLLLOOOOCCCCAAAALLLL____VVVVIIIIEEEEWWWWEEEERRRR
  169.      ggggllllGGGGeeeetttt with argument GGGGLLLL____LLLLIIIIGGGGHHHHTTTT____MMMMOOOODDDDEEEELLLL____TTTTWWWWOOOO____SSSSIIIIDDDDEEEE
  170.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____LLLLIIIIGGGGHHHHTTTTIIIINNNNGGGG
  171.  
  172.  
  173. MMMMAAAACCCCHHHHIIIINNNNEEEE DDDDEEEEPPPPEEEENNNNDDDDEEEENNNNCCCCIIIIEEEESSSS
  174.      On OOOOccccttttaaaannnneeee2222 VVVVPPPPrrrroooo systems, ggggllllLLLLiiiigggghhhhttttMMMMooooddddeeeellll with GGGGLLLL____SSSSEEEEPPPPAAAARRRRAAAATTTTEEEE____SSSSPPPPEEEECCCCUUUULLLLAAAARRRR____CCCCOOOOLLLLOOOORRRR is
  175.      not compatible with fragment lighting.  If fragment lighting is enabled,
  176.      it will override the separate specular color light model.
  177.  
  178.      On OOOOccccttttaaaannnneeee2222 VVVVPPPPrrrroooo systems, use of the texture q coordinate to achieve
  179.      projective texture effects will be processed on a per-vertex basis
  180.      instead of a per-pixel basis, unless the the texture matrix is set up to
  181.      be projective.  (A projective texture matrix is defined to be one in
  182.      which any of the 13th, 14th or 15th elements is non-zero.)  In addition,
  183.      if either two-sided lighting or fragment lighting is in effect,
  184.      projective texture effects will always be processed on a per-vertex
  185.      basis.
  186.  
  187.  
  188. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  189.      ggggllllLLLLiiiigggghhhhtttt, ggggllllMMMMaaaatttteeeerrrriiiiaaaallll
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.